import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
import My from '../views/My.vue'
import One from '../views/One.vue'
import Two from '../views/Two.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',//重定项
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/home/one',
        name: 'One',
        component: One,
      },
      {
        path: '/home/two',
        name: 'Two',
        component: Two,
      },
    ]
  },
  {
    path: '/about',
    name: 'About',
    component: About
  },
  {
    path: '/my',
    name: 'My',
    component: My
  }
]

const router = new VueRouter({
  routes
})

export default router
